<template>
  <BasicModal
    v-bind="$attrs"
    @register="register"
    :title="displayModuleTitle"
    okText="保存执行信息"
    centered
    @ok="clickSaveExecuteInfo"
    :destroy-on-close="true"
    :width="showCheckForm === true ? '1300px' : '800px'"
    :bodyStyle="{ height: '490px' }"
  >
    <div style="display: flex; flex-wrap: nowrap; flex-direction: row">
      <div style="flex: 1">
        <BasicForm @register="registerExecuteForm" :labelWrap="true" :destroyOnClose="true">
          <template #hasexec="{ model, field }">
            <a-radio-group v-model:value="model[field]" class="hasexecRadioButtonGroup">
              <a-radio-button :value="true">任务执行完成</a-radio-button>
              <a-radio-button :value="false">任务未全部完成</a-radio-button>
            </a-radio-group>
          </template>

          <template #isnormal="{ model, field }">
            <a-radio-group v-model:value="model[field]" class="isnormalRadioButtonGroup">
              <a-radio-button :value="true">均正常</a-radio-button>
              <a-radio-button :value="false">发现异常/隐患</a-radio-button>
            </a-radio-group>
          </template>
          <!-- <template #checkForm="{ model, field }">
            <a-button type="primary" @click="openCheckFormChooseModal">{{
              showCheckForm ? '切换检查表' : '选择检查表'
            }}</a-button>
          </template> -->
          <template #sign="{ model, field }">
            <div style="margin-bottom: 5px"
              ><a-button type="primary" @click="onOpenEsignModalButtonClick">打开签名板</a-button
              ><a-button danger type="text" v-if="model[field]" @click="setSignValue(null)"
                >清空</a-button
              ></div
            >
            <a-image :src="getImageFileUrlPrefix + model[field]" :width="150" v-if="model[field]" />
          </template>
        </BasicForm>
      </div>

      <div v-if="showCheckForm" style="width: 500px; height: 450px; overflow-y: auto">
        <h3 style="font-size: 15px; font-weight: 600">{{ formOption.title }}</h3>
        <a-form
          :model="checkResult"
          ref="checkFormRef"
          :rules="rules"
          layout="vertical"
          v-if="Object.keys(checkResult).length > 0"
        >
          <div v-for="(item, index) in checkFormSchema">
            <a-divider
              orientation="left"
              v-if="
                item.component == 'Divider' &&
                checkFormSchema.filter((item) => item.component == 'Divider')?.length > 1
              "
              >{{ item.label }}</a-divider
            >
            <a-form-item
              v-if="item.component != 'Divider'"
              :name="item.field"
              :labelCol="{ span: 22 }"
              :label="item.label"
              :required="item.required"
              :wrapperCol="{ span: 22 }"
            >
              <a-radio-group
                style="margin-bottom: 10px"
                v-model:value="checkResult[item.field].value"
                :options="item.options"
              ></a-radio-group>
              <a-input
                style="margin-bottom: 5px"
                :placeholder="item.description ?? '请补充说明'"
                v-show="
                  item.contenttype == 1 ||
                  (item.contenttype == 3 &&
                    checkResult[item.field].value == item.options[item.options.length - 1].value)
                "
                v-model:value="checkResult[item.field].description"
              />
              <BasicUpload
                @change="uploadFileChange()"
                style="margin-top: 5px"
                v-if="
                  item.minimgcount &&
                  (item.contenttype == 1 ||
                    (item.contenttype == 3 &&
                      checkResult[item.field].value == item.options[item.options.length - 1].value))
                "
                :maxSize="1024"
                :multiple="true"
                v-model:value="checkResult[item.field].images"
                :api="uploadApi"
                :uploadParams="{ system: 'ehs', module: 'attachment', title: '' }"
                :showPreviewNumber="true"
                :showUploadList="{
                  showPreviewIcon: true,
                  showRemoveIcon: true,
                  showDownloadIcon: false,
                }"
              />
            </a-form-item>
          </div>
        </a-form>
      </div>
    </div>

    <EsignModal @register="registerSignModal" @success="setSignValue" />
    <Loading :loading="loading" tip="加载中" />
  </BasicModal>
</template>
<script lang="ts">
  import { computed, defineComponent, ref, unref, onMounted, watch } from 'vue';
  import { addOrUpdateExecuteRecordSchema } from './taskBench.data';
  import { BasicForm, useForm } from '/@/components/Form/index';
  import { getUserOrganization } from '/@/api/ehs/organization';
  import { getAllTaskCategory } from '/@/api/ehs/taskCategory';
  import { useGlobSetting } from '/@/hooks/setting';
  const { globalProjectCode } = useGlobSetting();
  import { queryEnumOptions } from '/@/api/platform/enum';
  import { QcUnifyTransToChildProps } from '/#/QcUnify';
  import { OperationTypeEnum } from '/@/enums/appEnum';
  import { displayTitle } from '/@/utils/QcUnifyUtil';
  import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
  import { useUserStore } from '/@/store/modules/user';
  import moment from 'moment';
  import { uploadApi } from '/@/api/platform/upload';
  import { BasicUpload } from '/@/components/Upload';
  import { useGlobSetting } from '/@/hooks/setting';
  import { getImageFileApi } from '/@/api/platform/file';
  import { getHazardByOneUnit, getUnitHazards, getUnitHiddenTrouble } from '/@/api/ehs/hazard';
  import { queryUnitDivision } from '/@/api/ehs/unitDivision';
  import EsignModal from '../Component/EsignModal.vue';
  import { getFacilityList } from '/@/api/ehs/facility';
  import { getTaskInfo } from '/@/api/ehs/task';
  import { getTaskItemCheckTable } from '/@/api/ehs/taskItem';
  import { Loading } from '/@/components/Loading';
  import {
    getOneExecuteRecord,
    addExecuteRecord,
    updateExecuteRecord,
  } from '/@/api/ehs/taskExecute';
  import { queryCheckForm, getCheckRecord } from '/@/api/ehs/checkForm';
  import { getCheckFormFull, saveCheckRecord } from '/@/api/ehs/checkForm';
  import { useMessage } from '/@/hooks/web/useMessage';
  import { treeToList } from '/@/utils/helper/treeHelper';
  const { createMessage } = useMessage();
  export default defineComponent({
    components: {
      BasicForm,
      BasicModal,
      EsignModal,
      BasicUpload,
      Loading,
    },
    name: 'AddOrUpdateExecuteRecord',
    setup(props, { emit }) {
      const qcUnifyProps = ref<QcUnifyTransToChildProps>();
      const operateType = ref(OperationTypeEnum.UN_KNOWN);
      const userStore = useUserStore();
      const { uploadUrl } = useGlobSetting();
      const getImageFileUrlPrefix = ref<string>(uploadUrl + getImageFileApi);
      const dataId = ref(''); // 执行记录id
      const orgcode = ref('');
      const loading = ref(false);
      const taskItemRecord = ref({}); // 该任务项记录的信息

      const formOption = ref({}); // 检查表完整信息
      const checkFormRef = ref<FormInstance>();
      const checkResult = ref({}); // 检查填写结果
      const checkFormSchema = ref<formSchema>([]); // 检查表schema配置
      const rules = ref({}); // 检查表校验

      const chooseCheckFormId = ref(); // 选择的检查表的tableid
      const showCheckForm = ref(false); // 是否显示检查表

      const { realName = '', avatar, desc } = userStore.getUserInfo || {};
      const projectCode = ref<String>(globalProjectCode);
      const taskTypeOptions = ref([]);
      // const taskStatusOptions = ref([]);
      const taskInfo = ref({});
      const [
        registerExecuteForm,
        {
          setFieldsValue: setExecuteFieldsValue,
          resetFields: resetExecuteFields,
          validate,
          clearValidate,
          updateSchema,
        },
      ] = useForm({
        labelWidth: 150,
        schemas: addOrUpdateExecuteRecordSchema,
        showActionButtonGroup: false,
        actionColOptions: {
          span: 24,
        },
      });
      const [registerSignModal, { openModal: openEsignModal }] = useModal();
      // const [registerChooseForm, { openModal: openChooseFormModal }] = useModal();
      const [register, { closeModal }] = useModalInner((data) => {
        loading.value = true;
        chooseCheckFormId.value = null;
        checkFormRef.value?.clearValidate();
        checkResult.value = {};
        formOption.value = {};
        resetExecuteFields();
        if (data != undefined && data != null) {
          let unrefData = unref(data);
          qcUnifyProps.value = unrefData;
          //接收父组件传递的数据
          if (unrefData?.operateType) {
            //判断是否传入op属性
            operateType.value = unrefData.operateType;
          }
          taskItemRecord.value = data.taskItemRecord;

          getTaskInfo(data.taskItemRecord.taskid).then((res) => {
            taskInfo.value = res;
            //编辑
            if (unrefData?.dataId) {
              dataId.value = unrefData.dataId;
              // 通过执行记录id,单元id以及任务项id获取执行记录以及检查表id getItemCheckTable
              getOneExecuteRecord(unrefData.dataId).then((res) => {
                if (res.checkrecordid) {
                  // 如果上次执行记录中存在检查表,则显示检查表(使用上次保存执行记录时留下的配置)
                  chooseCheckForm(res.unitid, taskItemRecord.value.itemid, dataId.value);
                } else {
                  // 执行记录中没有检查表,说明这个任务不是必须要检查表的,那就暂时不显示
                  showCheckForm.value = false;
                  chooseCheckFormId.value = '';
                  checkFormSchema.value = [];
                  checkResult.value = {};
                }
                loading.value = false;
                if (Object.keys(res).length > 0) {
                  setExecuteFieldsValue({
                    ...res,
                    execsign: res.execsign ? res.execsign : userStore.getUserInfo?.sign,
                    itemname: taskItemRecord.value.itemname,
                    execattachment: res.execattachment ? JSON.parse(res.execattachment) : [],
                    exectm: [
                      //设置执行开始时间为计划开始时间，截止时间为当天
                      // res.begintm
                      //   ? moment(res.begintm).format('YYYY-MM-DD')
                      //   : moment().format('YYYY-MM-DD'),
                      // res.endtm
                      //   ? moment(res.endtm).format('YYYY-MM-DD')
                      //   : moment().format('YYYY-MM-DD'),
                      res.begintm
                        ? moment(res.begintm).format('YYYY-MM-DD')
                        : moment().format('YYYY-MM-DD'),
                      moment().format('YYYY-MM-DD'),
                    ],
                    executor: res.executor ?? realName,
                  });
                }
              });
            } else {
              // 新增
              dataId.value = null;
              chooseCheckFormId.value = '';
              checkFormSchema.value = [];
              checkResult.value = {};
              // 新增分两种情况, 一种是创建时已选了单元的,一种是检查类(自定义分组)
              // 如果已选了单元,则直接使用单元id以及任务项id获取
              // 如果没选, 就监听unitid 的change事件, 每次更改都获取对应单元id的检查表信息
              if (taskInfo.value.needchecktable === true) {
                loading.value = false;
                if (taskItemRecord.value.unitid) {
                  showCheckForm.value = true;
                  chooseCheckForm(
                    taskItemRecord.value.unitid,
                    taskItemRecord.value.itemid,
                    dataId.value,
                  );
                } else {
                  showCheckForm.value = false;
                }
              } else {
                loading.value = false;
                // 如果不必需就暂时不选
                showCheckForm.value = false;
              }

              setExecuteFieldsValue({
                exectm: [
                  moment(taskItemRecord.value.planbegintm).format('YYYY-MM-DD'),
                  moment().format('YYYY-MM-DD'),
                ],
                executetmstr:
                  taskItemRecord.value.planfrequencytype == 0 &&
                  taskItemRecord.value.planfrequencycount == 1
                    ? moment().format('YYYY年MM月DD日')
                    : taskItemRecord.value.plantmstr,
                itemname: taskItemRecord.value.itemname,
                unitid: taskItemRecord.value.unitid,
                factoryid: taskItemRecord.value.factoryid,
                hazardid: taskItemRecord.value.hazardid,
                executor: realName,
                execsign: userStore.getUserInfo?.sign,
              });
            }
            // 从单元分类关联的对象提供选择
            let result = taskTypeOptions.value.filter(
              (item) => item.label == taskItemRecord.value.catname,
            )[0];
            console.log('result', result);
            updateSchema([
              {
                field: 'unitid',
                label: (result?.catname ?? taskItemRecord.value.catname) + '单元',
                ifShow: true, // result?.objecttype !== 0
                required: true, //result?.objecttype !== 0 && result?.notnull
                componentProps: ({ formActionType, formModel }) => {
                  return {
                    api: queryUnitDivision, //数据接口
                    disabled: taskItemRecord.value.unitid ? true : false,
                    params: {
                      includechilds: true,
                      isdept: false,
                      flagisvalid: false,
                      orgcode: orgcode.value,
                    }, //接口参数
                    fieldNames: { label: 'unitname', value: 'unitid', children: 'children' },
                    listHeight: 200,
                    immediate: true, //是否立即请求接口，否则将在第一次点击时候触发请求
                    treeDefaultExpandAll: true, //默认展开
                    onChange: (e) => {
                      formModel.hazardid = '';
                      formModel.facilityid = '';
                      if (taskInfo.value.needchecktable) {
                        // 每次更改单元都要用任务项id以及单元id获取对应的检查表更新页面
                        chooseCheckForm(e, taskItemRecord.value.itemid, dataId.value);
                        showCheckForm.value = true;
                      }
                    },
                  };
                },
              },
              {
                field: 'hazardid',
                label: result?.catname + '危险源',
                ifShow: ({ values }) =>
                  (result?.objecttype == 2 || result?.objecttype == 4 || result?.objecttype == 8) &&
                  values.unitid,
                required:
                  (result?.objecttype == 2 || result?.objecttype == 4 || result?.objecttype == 8) &&
                  result?.notnull,
                componentProps: ({ formModel, formActionType }) => {
                  return {
                    api:
                      result.objecttype == 2
                        ? getHazardByOneUnit
                        : result.objecttype == 4
                        ? getUnitHazards
                        : getUnitHiddenTrouble,
                    // mode: "multiple",
                    listHeight: 150,
                    disabled: dataId.value == null && taskItemRecord.value.hazardid ? true : false,
                    resultField: 'hazards',
                    params: { unitid: formModel.unitid }, //接口参数
                    fieldNames: { label: 'hazardname', value: 'hazardid' },
                    immediate: true, //是否立即请求接口，否则将在第一次点击时候触发请求
                    // treeCheckable: true, //	显示checkbox，多选
                    treeDefaultExpandAll: true, //默认展开
                  };
                },
              },
              {
                field: 'facilityid',
                label: result?.catname + '设备设施',
                ifShow: ({ values }) => result?.objecttype == 32 && values.unitid,
                required: result?.objecttype == 32 && result?.notnull,
                componentProps: ({ formActionType, formModel }) => {
                  return {
                    api: getFacilityList,
                    listHeight: 150,
                    disabled: dataId.value == null && taskItemRecord.value.facility ? true : false,
                    // mode: "multiple",
                    params: { orgcode: formModel.orgcode, status: 1, unitid: formModel.unitid }, //接口参数
                    fieldNames: { label: 'name', value: 'id' },
                    immediate: true, //是否立即请求接口，否则将在第一次点击时候触发请求
                    // treeCheckable: true, //	显示checkbox，多选
                    treeDefaultExpandAll: true, //默认展开
                  };
                },
              },
            ]);
          });
        }
      });

      function onOpenEsignModalButtonClick() {
        let propsData: QcUnifyTransToChildProps = {
          moduleName: '隐患治理整改',
          operateString: '签字',
          dataId: dataId.value,
        };
        openEsignModal(true, propsData);
      }

      function setSignValue(sign) {
        setExecuteFieldsValue({
          execsign: sign,
        });
      }

      /**
       * 查找检查表并获取检查表记录以及配置
       */
      function chooseCheckForm(unitid, taskitemid, execid) {
        rules.value = {};
        checkResult.value = {};
        showCheckForm.value = true;

        getTaskItemCheckTable({ unitid: unitid, itemid: taskitemid, execid: execid })
          .then((res) => {
            if (!res) {
              showCheckForm.value = false;
              chooseCheckFormId.value = null;
              checkFormRef.value?.clearValidate();
              checkResult.value = {};
              formOption.value = {};
              checkFormSchema.value = [];
              return;
            }
            let record = res.record;
            let table = res.table;
            chooseCheckFormId.value = table.tableid;
            if (record?.content) {
              // 有检查记录,直接取检查记录的值(包含检查表配置以及检查表结果赋值)
              let content = record.content ? JSON.parse(record.content) : {};
              checkResult.value = content.content;
              checkFormSchema.value = content.schema;
              formOption.value.title = content.title;
            } else {
              // 没有检查记录,就根据返回的检查表信息生成检查表
              checkResult.value = {};
              formOption.value = {
                ...table,
                title: table.groups?.length == 1 ? table.groups[0]?.title : table.title,
              };
              let schema = [];
              formOption.value.groups?.forEach((item, index) => {
                schema.push({
                  index: index + 1,
                  label: index + 1 + '. ' + item.title,
                  field: item.title,
                  component: 'Divider',
                  required: false,
                  childrenLength: item.items?.length,
                });
                item.items?.forEach((item2, index2) => {
                  schema.push({
                    index: index + 1 + '.' + (index2 + 1),
                    field: item2.title,
                    parentId: item.groupid,
                    parentGroupName: item.title,
                    contenttype: item2.contenttype,
                    minimgcount: item2.minimgcount,
                    label: index + 1 + '.' + (index2 + 1) + item2.title,
                    description: item2.description,
                    required: item2.notnull,
                    options: JSON.parse(item2.options),
                  });
                });
              });
              checkFormSchema.value = schema;
              checkFormSchema.value
                .filter((item) => item.component !== 'Divider')
                ?.forEach((item) => {
                  checkResult.value[item.field] = {
                    value: '',
                    description: '',
                    images: [],
                  };
                  console.log(item, 'validateitem');
                  if (item.required) {
                    rules.value[item.field] = [
                      {
                        required: true,
                        trigger: 'change',
                        validator: (rule, value) => ruleValidate(rule, value, item),
                      },
                    ];
                  } else {
                    rules.value[item.field] = [
                      {
                        trigger: 'change',
                        validator: (rule, value) => ruleValidate(rule, value, item),
                      },
                    ];
                  }
                });
            }
          })
          .catch((err) => {
            console.log(err);
            showCheckForm.value = false;
            chooseCheckFormId.value = null;
            checkFormRef.value?.clearValidate();
            checkResult.value = {};
            formOption.value = {};
            checkFormSchema.value = [];
          });
      }

      function ruleValidate(rule, value, item) {
        console.log(value, item, 'validate');
        if (item.required) {
          if (!value.value || value.value == '') {
            return Promise.reject(rule.field + '不能为空');
          }
          if (
            item.contenttype == 1 ||
            (item.contenttype == 3 && value.value == item.options[item.options.length - 1].value)
          ) {
            if (!value.description || value.description == '') {
              return Promise.reject(rule.field + '补充内容不能为空');
            }
          }
        }
        if (
          item.minimgcount &&
          (item.contenttype == 1 ||
            (item.contenttype == 3 &&
              value.value == item.options[item.options.length - 1].value)) &&
          value.images.length < item.minimgcount
        ) {
          return Promise.reject(rule.field + '至少上传' + item.minimgcount + '张图片');
        }
        return Promise.resolve();
      }

      /**
       * 保存执行记录(新增和修改记录时,同时传入检查表内容)
       */
      async function clickSaveExecuteInfo() {
        const values = await validate();
        loading.value = true;
        values.execattachment = JSON.stringify(values.execattachment);
        values.endtm = moment(values.exectm[1]).endOf('day').format('YYYY-MM-DD');
        values.begintm = moment(values.exectm[0]).startOf('day').format('YYYY-MM-DD');
        values.checkrecordid = '';
        if (values.unitid) {
          await queryUnitDivision({
            includechilds: true,
            isdept: false,
            flagisvalid: false,
            orgcode: orgcode.value,
          }).then((res) => {
            values.unitname = treeToList(res).find((item) => item.unitid == values.unitid).unitname;
          });
        }
        if (showCheckForm.value === true) {
          try {
            checkFormRef.value
              .validate()
              .then(() => {
                console.log(checkResult.value, 'checkResult');
                let content = {};
                for (let key in checkResult.value) {
                  content[key] = {
                    ...checkResult.value[key],
                    images: checkResult.value[key].images,
                  };
                }

                if (operateType.value == OperationTypeEnum.ADD) {
                  addExecuteRecord({
                    ...taskItemRecord.value,
                    ...values,
                    checktableid: chooseCheckFormId.value,
                    checkcontent: JSON.stringify({
                      content: content,
                      schema: checkFormSchema.value,
                      title:
                        checkFormSchema.value.filter((item) => item.component == 'Divider')
                          ?.length == 1
                          ? checkFormSchema.value.find((item) => item.component == 'Divider')?.field
                          : formOption.value.title,
                    }),
                  })
                    .then((res) => {
                      if (!res) {
                        createMessage.success('保存执行记录成功');
                        emit('success');
                        loading.value = false;
                        closeModal();
                      } else {
                        loading.value = false;
                        createMessage.error('保存执行记录失败');
                      }
                    })
                    .catch((error) => {
                      loading.value = false;
                    });
                } else if (operateType.value == OperationTypeEnum.EDIT) {
                  updateExecuteRecord({
                    ...taskItemRecord.value,
                    ...values,
                    checktableid: chooseCheckFormId.value,
                    checkcontent: JSON.stringify({
                      content: content,
                      schema: checkFormSchema.value,
                      title:
                        checkFormSchema.value.filter((item) => item.component == 'Divider')
                          ?.length == 1
                          ? checkFormSchema.value.find((item) => item.component == 'Divider')?.field
                          : formOption.value.title,
                    }),
                    execid: dataId.value,
                  })
                    .then((res) => {
                      if (!res) {
                        createMessage.success('更新执行记录成功');
                        loading.value = false;
                        emit('success');
                        closeModal();
                      } else {
                        loading.value = false;
                        createMessage.error('更新执行记录失败');
                      }
                    })
                    .catch((error) => {
                      loading.value = false;
                    });
                }
              })
              .catch((error) => {
                console.log('error', error);
                loading.value = false;
              });
          } catch (e) {
            createMessage.error('当前检查表中无检查项配置, 请给该检查表配置检查项。');
            loading.value = false;
          }
        } else {
          if (taskInfo.value.needchecktable === true) {
            loading.value = false;
            return createMessage.error('该任务必须要填写检查表, 当前选择单元无对应检查表。');
          }
          if (operateType.value == OperationTypeEnum.ADD) {
            addExecuteRecord({ ...taskItemRecord.value, ...values })
              .then((res) => {
                if (!res) {
                  createMessage.success('保存执行记录成功');
                  emit('success');
                  loading.value = false;
                  closeModal();
                } else {
                  loading.value = false;
                  createMessage.error('保存执行记录失败');
                }
              })
              .catch((error) => {
                loading.value = false;
              });
          } else if (operateType.value == OperationTypeEnum.EDIT) {
            updateExecuteRecord({
              ...taskItemRecord.value,
              ...values,
              execid: dataId.value,
            })
              .then((res) => {
                if (!res) {
                  loading.value = false;
                  createMessage.success('更新执行记录成功');
                  emit('success');
                  closeModal();
                } else {
                  loading.value = false;
                  createMessage.error('更新执行记录失败');
                }
              })
              .catch((error) => {
                loading.value = false;
              });
          }
        }
      }

      onMounted(() => {
        // 需要传入用户有效组织
        getUserOrganization(projectCode.value).then((res) => {
          orgcode.value = res.orgcode;
          getAllTaskCategory(res.orgcode).then((res) => {
            taskTypeOptions.value = res.map((item) => {
              return {
                ...item,
                label: item.catname,
                value: item.catcode,
              };
            });
          });
        });
      });

      function uploadFileChange() {
        checkFormRef.value.validateFields();
      }

      let displayModuleTitle = computed(() => {
        return displayTitle(qcUnifyProps.value);
      });

      watch(
        () => checkFormSchema.value,
        (newV) => {
          console.log('change checkFormSchema');
          newV
            .filter((item) => item.component !== 'Divider')
            ?.forEach((item) => {
              if (item.required) {
                rules.value[item.field] = [
                  {
                    required: true,
                    trigger: 'change',
                    validator: (rule, value) => ruleValidate(rule, value, item),
                  },
                ];
              } else {
                rules.value[item.field] = [
                  {
                    trigger: 'change',
                    validator: (rule, value) => ruleValidate(rule, value, item),
                  },
                ];
              }
            });
        },
      );

      return {
        loading,
        showCheckForm,
        operateType,
        orgcode,
        getImageFileUrlPrefix,
        chooseCheckFormId,
        taskItemRecord,
        setSignValue,
        onOpenEsignModalButtonClick,
        register,
        // registerChooseForm,
        registerExecuteForm,
        registerSignModal,
        // openCheckFormChooseModal,
        // openCheckFormModal,
        clickSaveExecuteInfo,
        chooseCheckForm,
        displayModuleTitle,
        uploadApi,
        rules,
        checkFormSchema,
        checkFormRef,
        checkResult,
        formOption,
        uploadFileChange,
      };
    },
  });
</script>
<style scoped>
  .ant-radio-button-wrapper.ant-radio-button-wrapper-checked {
    color: #000;
  }
  .ant-radio-group-solid
    .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover {
    color: #000;
  }
  .hasexecRadioButtonGroup .ant-radio-button-wrapper:nth-child(1).ant-radio-button-wrapper-checked {
    background-color: rgb(57, 154, 65);
    color: #ffffff;
    border: rgb(9, 91, 9);
  }
  .hasexecRadioButtonGroup .ant-radio-button-wrapper:nth-child(2).ant-radio-button-wrapper-checked {
    background-color: rgb(255, 246, 69);
    color: #000000;
    border: rgb(161, 166, 10);
  }
  .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled)::before {
    background: rgb(203, 203, 203);
  }

  .isnormalRadioButtonGroup
    .ant-radio-button-wrapper:nth-child(1).ant-radio-button-wrapper-checked {
    background-color: rgb(57, 154, 65);
    color: #ffffff;
    border: rgb(9, 91, 9);
  }
  .isnormalRadioButtonGroup
    .ant-radio-button-wrapper:nth-child(2).ant-radio-button-wrapper-checked {
    background-color: rgb(185, 26, 26);
    color: #ffffff;
    border: rgb(93, 17, 17);
  }
</style>
